x86: replace PAT initialisation magic value with a #define
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 7 Aug 2009 16:30:33 +0000 (17:30 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 7 Aug 2009 16:30:33 +0000 (17:30 +0100)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/vmcb.c
xen/arch/x86/hvm/vmx/vmcs.c
xen/include/asm-x86/msr-index.h

index 767803a7daf04a106bee0681380cf4c174077147..6236ead0beccc8f8c70f79d58a69a18af3cee893 100644 (file)
@@ -266,7 +266,7 @@ static int svm_vmcb_restore(struct vcpu *v, struct hvm_hw_cpu *c)
     if ( paging_mode_hap(v->domain) )
     {
         vmcb->np_enable = 1;
-        vmcb->g_pat = 0x0007040600070406ULL; /* guest PAT */
+        vmcb->g_pat = MSR_IA32_CR_PAT_RESET; /* guest PAT */
         vmcb->h_cr3 = pagetable_get_paddr(v->domain->arch.phys_table);
     }
 
index d5f059aa6a098265edfcc74f78c70fa0eac8889f..7366ecd22b6052d19fc9c21414f79cc32c8fa36f 100644 (file)
@@ -232,7 +232,7 @@ static int construct_vmcb(struct vcpu *v)
     if ( paging_mode_hap(v->domain) )
     {
         vmcb->np_enable = 1; /* enable nested paging */
-        vmcb->g_pat = 0x0007040600070406ULL; /* guest PAT */
+        vmcb->g_pat = MSR_IA32_CR_PAT_RESET; /* guest PAT */
         vmcb->h_cr3 = pagetable_get_paddr(v->domain->arch.phys_table);
 
         /* No point in intercepting CR3 reads/writes. */
index 47ce17e61b00807d6410fadaf71fd2d60dd9f27f..e9daac5ecc532b93080ae26e7b305f54edc9c083 100644 (file)
@@ -743,7 +743,7 @@ static int construct_vmcs(struct vcpu *v)
         u64 host_pat, guest_pat;
 
         rdmsrl(MSR_IA32_CR_PAT, host_pat);
-        guest_pat = 0x7040600070406ULL;
+        guest_pat = MSR_IA32_CR_PAT_RESET;
 
         __vmwrite(HOST_PAT, host_pat);
         __vmwrite(GUEST_PAT, guest_pat);
index 2a2cfa6eac5c05122cd25028ff2ee4178209dbae..aafcec821c1409e4f7817d622e9b069a4894c7ef 100644 (file)
@@ -87,6 +87,7 @@
 #define MSR_IA32_MTRR_PHYSMASK7     0x0000020f
 
 #define MSR_IA32_CR_PAT             0x00000277
+#define MSR_IA32_CR_PAT_RESET       0x0007040600070406ULL
 
 #define MSR_IA32_MC0_CTL               0x00000400
 #define MSR_IA32_MC0_STATUS            0x00000401